//
//  HomeViewModel.m
//  ServiceCode
//
//  Created by 曹连华 on 2020/4/1.
//

#import "HomeViewModel.h"
#import "HomeTitleTVCellModel.h"
#import <ServiceCode/Router.h>
@implementation HomeViewModel

- (void)resetDataSource {
    [self.dataSource resetRowListInSection:[self rows]];
}

- (LVBaseCellRowModel *)didSelectedRowModelWithindexPath:(NSIndexPath *)indexPath {
    HomeTitleTVCellModel *row = (HomeTitleTVCellModel *)[self.dataSource rowModelAtIndex:indexPath];
    [[Router sharedInstance]routeWithKey:row.routerKey];
    return row;
}

- (NSArray <LVBaseCellRowModel *> *)rows {
    return @[[[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"基础动画-CABasicAnimation" routerKey:@"baseanimation"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"关键帧动画-KeyframeAnimation" routerKey:@"keyframeanimation"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"弹簧动画-CASpringAnimation" routerKey:@"springanimation"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"转场动画" routerKey:@"transitionanimation"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"组件库" routerKey:@"components"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"Network网络库使用示例" routerKey:@"networkdome"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"lottie_ios_Animation" routerKey:@"lottie_iosAnimation"],
             [[HomeTitleTVCellModel alloc]initWithCellClass:@"HomeTitleTVCell" title:@"深色模式切换" routerKey:@"userInterface"]];
   
}
@end
